package dao

import (
	"gorm.io/gorm"
	"micro-grpc-server/library/database"
	"micro-grpc-server/services/user/internal/conf"
)

type UserDao struct {
	conf      *conf.Config
	Db        *gorm.DB
	scenarios map[string]struct{}
}

func NewDao(config *conf.Config) *UserDao {
	return &UserDao{
		conf: config,
		Db:   database.NewMysql(config.Database),
		scenarios: map[string]struct{}{
			"chaping":  {},
			"nicetrip": {},
		},
	}
}

func (d *UserDao) CheckScenario(scenario string) bool {
	_, ok := d.scenarios[scenario]
	return ok
}
